
#ifndef  _RADIX_ARCHAISM_LOGGER_H_
#define  _RADIX_ARCHAISM_LOGGER_H_

#include <Archaism/Header.h>
#include <fstream>

_BeginNamespace(Radix)

class Logger
{
	_ForbidCopy(Logger);
	_ForbidAssign(Logger);

public:
	enum Level
	{
		eLevel_Info,
		eLevel_Notice,
		eLevel_Warning,
		eLevel_Error
	};

public:
	Logger();
	~Logger();

public:
	bool open(const String& name, const Level& lev = eLevel_Info);
	void close();
	Level level() const;
	void setLevel(const Level& lev);
	void logMessage(const Level& lev, const String::value_type* fmt, ...);
	void logMessage(const String& message);

private:
	String mName;
	Level mLevel;
	std::ofstream mStream;
};

_EndNamespace(Radix)

#endif//_RADIX_ARCHAISM_LOGGER_H_
